<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>商品管理 - 编辑商品</title>
<?php include($this->c['_homes']['_viewsHome'].'/_global/_head.php');?>
<link rel="stylesheet" type="text/css" href="/style/assets/plugins/bootstrap-datetimepicker/css/datetimepicker.css" />
<link href="/style/assets/css/summernote.css" rel="stylesheet">
<link href="/style/assets/css/summernote-bs3.css" rel="stylesheet">
<style type="text/css">
#txt1 {
    width: 99%;
}

#div_items {
    position: relative;
    width: 100%;
    height: 200px;
    border: 1px solid #66afe9;
    border-top: 0px;
    overflow: auto;
    display: none;
}

.div_item {
    width: 100%;
    height: 20px;
    margin-top: 1px;
    font-size: 13px;
    line-height: 20px;
}
</style>
</head>
<!-- BEGIN BODY -->
<body class="page-header-fixed page-sidebar-fixed">
<!-- BEGIN HEADER -->
<?php include($this->c['_homes']['_viewsHome'].'/_global/head.php');?>
<!-- END HEADER -->
<div class="clearfix"></div>
<!-- BEGIN CONTAINER -->
<div class="page-container" > 
  <!-- BEGIN HORIZONTAL MENU PAGE SIDEBAR1 -->
  <?php include($this->c['_homes']['_viewsHome'].'/_global/menu.php');?>
  <!-- END BEGIN HORIZONTAL MENU PAGE SIDEBAR --> 
  <!-- BEGIN PAGE -->
  <div class="page-content"> 
    <!-- BEGIN PAGE HEADER-->
    <div class="row">
      <div class="col-md-12"> 
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title"> 编辑商品 </h3>
        <ul class="page-breadcrumb breadcrumb">
          <li> <i class="icon-home"></i> <a href="/manage">后台</a> <i class="icon-angle-right"></i> </li>
          <li> 商品管理 <i class="icon-angle-right"></i> </li>
          <li> <a href="channelgoods">商品列表</a> <i class="icon-angle-right"></i> </li>
          <li>编辑商品</li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB--> 
      </div>
    </div>
    <!-- END PAGE HEADER--> 
    <!-- BEGIN PAGE CONTENT-->
    
    <div class="row">
      <div class="col-md-12"> 
        <!-- BEGIN SAMPLE FORM PORTLET-->
        <form class="form-horizontal" method="post" onSubmit="return chkfrm();" action="/channel/savegoods" role="form" enctype="multipart/form-data">
          <input type="hidden" name="act" value="edit">
          <input type="hidden" name="show_docid" value="<?= $this->data['thumb_docid']>0 ?$this->data['thumb_docid']:0;?>">
          <input type="hidden" name="pic_docid" value="<?= $this->data['pic_docid']>0 ?$this->data['pic_docid']:0;?>">
          <input type="hidden" name="thumb_docid" value="<?= $this->data['thumb_docid']>0 ?$this->data['thumb_docid']:0;?>">
          <input type="hidden" name="goods_id" value="<?=$this->data['goods_id'];?>">          
          <input type="hidden" name="ref" value="<?=$_SERVER['HTTP_REFERER'];?>">
          <div class="tabbable tabbable-custom boxless">
            <ul class="nav nav-tabs">
              <li class="active"><a href="#tab_0" data-toggle="tab">基本信息</a></li>
              <li class=""><a href="#tab_2" data-toggle="tab">商品详情</a></li>
              <li class=""><a href="#tab_3" data-toggle="tab">快递设置</a></li>
            </ul>
            <div class="tab-content"> 
              <!--Tab0-->
              <div class="tab-pane active" id="tab_0">
                <div class="portlet box blue ">
                  <div class="portlet-title">
                    <div class="caption"> <i class="icon-reorder"></i> 基本信息 </div>
                  </div>
                  <div class="portlet-body form">
                    <div class="form-body">
                      <div class="form-group">
                        <label  class="col-md-2 control-label">商品ID</label>
                        <div class="col-md-9">
                        <h5><?=$this->data['goods_id'];?></h5>                          
                        </div>
                      </div>                      
                      <div class="form-group">
                        <label  class="col-md-2 control-label">商品名称<span class="required">*</span></label>
                        <div class="col-md-9">
                          <input type="text" name="goods_name" id="_goods_name" maxlength="80" class="form-control"  placeholder="请输入商品名称" value="<?=$this->data['goods_name'];?>">
                          <span class="help-block">80个汉字以内</span> </div>
                      </div>
                        <div class="form-group">
                            <label  class="col-md-2 control-label">商品小标题<span class="required"></span></label>
                            <div class="col-md-9">
                                <input type="text" name="goods_title" id="_goods_title" maxlength="100" class="form-control"  placeholder="请输入小标题" value="<?=$this->data['goods_title'];?>">
                                <span class="help-block">100个汉字以内</span> </div>
                        </div>
                      <div class="form-group">
                        <label  class="col-md-2 control-label">商品条形码</label>
                        <div class="col-md-6">
                          <input type="text" name="goods_barcode" id="_goods_barcode" value="<?=$this->data['goods_barcode'];?>" maxlength="30" class="form-control"  placeholder="例如：HPS881234">
                          <span class="help-block">30个字符以内，例如：EC1928</span> </div>
                      </div>

                      <div class="form-group">
                        <label  class="col-md-2 control-label">商品SKU</label>
                        <div class="col-md-6">
                          <input type="text" name="goods_sku"  value="<?=$this->data['goods_sku'];?>" maxlength="30" class="form-control"  >
                          <span class="help-block"></span> </div>
                      </div>

                        <div class="form-group">
                            <label  class="col-md-2 control-label">商品一级分类<span class="required">*</span></label>
                            <div class="col-md-6">
                                <select  id="_caid" class="form-control">
                                    <option value="">请选择商品一级分类</option>
                                    <?php
                                    if($this->cate){
                                        foreach($this->cate as $r){
                                            if($this->data['yi_caid']==$r['caid']) $slk=' selected';
                                            else $slk = '';
                                            ?>
                                            <option value="<?=$r['caid'];?>"<?=$slk;?>>
                                                <?=$r['name'];?>
                                            </option>
                                            <?php
                                        }
                                    }
                                    ?>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label  class="col-md-2 control-label">商品二级分类<span class="required">*</span></label>
                            <div class="col-md-6">
                                <select name="caid" id="_er_caid" class="form-control">
                                    <option value="">请选择商品二级分类</option>
                                    <?php
                                    if($this->ercate){
                                        foreach($this->ercate as $rs){
                                            if($this->data['caid']==$rs['caid']) $slk=' selected';
                                            else $slk = '';
                                            ?>
                                            <option value="<?=$rs['caid'];?>"<?=$slk;?>>
                                                <?=$rs['name'];?>
                                            </option>
                                            <?php
                                        }
                                    }
                                    ?>
                                </select>
                            </div>
                        </div>
                      <div class="form-group">
                        <label  class="col-md-2 control-label">商品类型<span class="required">*</span></label>
                        <div class="col-md-6">
                          <select name="goods_type" id="goods_type" class="form-control">
                            <?php
                            if($this->c['goods_type']){
                              foreach($this->c['goods_type'] as $goods_type=>$name){
                               
                                if($this->data['goods_type'] == $goods_type)
                                {
                                  $slk = ' selected';
                                }
                                else
                                {
                                  $slk = '';
                                }

                                echo '<option value="'.$goods_type.'"'.$slk.'>'.$name.'</option>';

                              }
                            }             
                            ?>
                          </select>
                        </div>
                      </div>

                        <div class="form-group">
                            <label  class="col-md-2 control-label">升级创客等级<span class="required">*</span></label>
                            <div class="col-md-6">
                                <select name="maker_level" id="maker_level" class="form-control">

                                    <?php
                                    if($this->c['maker']){
                                        foreach($this->c['maker'] as $m=>$name){

                                            if($this->data['maker_level'] == $m)
                                            {
                                                $slk = ' selected';
                                            }
                                            else
                                            {
                                                $slk = '';
                                            }

                                            echo '<option value="'.$m.'"'.$slk.'>'.$name.'</option>';

                                        }
                                    }
                                    ?>
                                </select>
                            </div>
                        </div>
                     <div class="form-group">
                        <label  class="col-md-2 control-label">关联小标题</label>
                        <div class="col-md-6">
                          <input type="text" name="rele_title" value="<?=$this->data['rele_title'];?>" maxlength="30" class="form-control"  placeholder="请输入关联小标题">
                          <span class="help-block">30个字符以内，例如：EC1928</span> </div>
                      </div>
                        <div class="form-group">
                          <label class="col-md-2 control-label">关联</label>
                          <div class="col-md-6">
                              <!--要模糊匹配的文本框-->
                              <input type="text" class="form-control" name="relevance_id" id="parent_uid" value="<?php if($this->data['relevance_id']){echo $this->data['relevance_id'].'-'.$this->data['title'];}?>" />

                              <!--模糊匹配窗口-->
                              <div id="div_items">
                                  <!--<div class="div_item">周杰伦</div>-->
                              </div>
                          </div>
                      </div>
                      <hr>
                       <div class="form-group">
                       <label  class="col-md-2 control-label">供应商<span class="required">*</span></label>
                        <div class="col-md-6">
                          <select name="supplierid" id="_supplierid" class="form-control">
                            <option value="">请选择供应商</option>
                            <?php
              							if($this->supplier){
              								foreach($this->supplier as $r){
              									if($this->data['supplierid']==$r['id']) $slk=' selected';
              									else $slk = '';
              								?>
                                          <option value="<?=$r['id'];?>"<?=$slk;?>>
                                          <?=$r['supplier'];?>
                                          </option>
                                   
                                          <?php
              									
              								}
              							}							
              							?>
                          </select>
                        </div>
                      </div>
                      <div class="form-group">
                        <label  class="col-md-2 control-label">商品品牌</label>
                        <div class="col-md-6">
                          <select name="brand_id" id="_brand_id" class="form-control">
                            <option value="">选择商品品牌</option>
                            <?php
                            if($this->brand){
                              foreach($this->brand as $py => $bd){
                                foreach($bd as $r)
                                {
                                  if($this->data['brand_id']==$r['brand_id']) $slk=' selected';
                                  else $slk='';
                                  echo '<option value="'.$r['brand_id'].'"'.$slk.'>'.$py.' '.stripslashes($r['name']).'</option>';
                                }                              
                              }
                            }             
                            ?>                           
                          </select>
                        </div>
                      </div>                      
                     <hr>
                      <div class="form-group memberprice">
                        <label  class="col-md-2 control-label">商品权重</label>
                        <div class="col-md-6">
                          <input type="text" name="weight"  maxlength="10" class="form-control" value="<?=$this->data['weight'];?>">
                          <span class="help-block">权重越大显示越靠前</span>
                         </div>
                      </div>                     
                      <hr>
                      <div class="form-group">
                        <label  class="col-md-2 control-label">商品重量</label>
                        <div class="col-md-2">
                          <div class="input-group input-medium">
                            <input class="form-control" id="_goods_weight" value="<?=$this->data['goods_weight'];?>" name="goods_weight" type="text">
                          </div>
                        </div>
                        <div class="col-md-1"></div>
                        <div class="col-md-2">
                          <select name="goods_weight_unit" class="form-control">
                            <option value="1" selected>克</option>
                          </select>
                        </div>
                      </div>
                      <div class="form-group memberprice">
                        <label  class="col-md-2 control-label">限购数量</label>
                        <div class="col-md-6">
                          <input type="text" name="purchasing_num" value="<?=$this->data['purchasing_num'];?>"  maxlength="10" class="form-control">
                         </div>
                      </div>    
                      <hr>
                       <div class="form-group">
                        <label  class="col-md-2 control-label">零售价格</label>
                        <div class="col-md-6">
                          <input type="text" name="shop_price" id="_shop_price" value="<?php if($this->data['shop_price']){echo $this->data['shop_price'];}else{echo "0.00";}?>" maxlength="10" class="form-control">
                          <span class="help-block">例如：10.00</span> </div>
                      </div>                      
                      <div class="form-group memberprice">
                        <label  class="col-md-2 control-label">市场价格</label>
                        <div class="col-md-6">
                          <input type="text" name="market_price" maxlength="10" class="form-control" value="<?php if($this->data['market_price']){echo $this->data['market_price'];}else{echo "0.00";}?>">
                          <span class="help-block">例如：10.00</span> </div>
                      </div> 
                      <div class="form-group memberprice">
                        <label  class="col-md-2 control-label">进货价格</label>
                        <div class="col-md-6">
                          <input type="text" name="purchase_price" id="_purchase_price" maxlength="10" class="form-control" value="<?php if($this->data['purchase_price']){echo $this->data['purchase_price'];}else{echo "0.00";}?>">
                          <span class="help-block">例如：10.00</span> </div>
                      </div>
                      <div class="form-group">
                        <label  class="col-md-2 control-label">硒米价格</label>
                        <div class="col-md-6">
                          <input type="text" name="ximi_price" id="ximi_price" value="<?=$this->data['ximi_price'] ? : '0.00'?>" maxlength="10" class="form-control">
                          <span class="help-block">例如：10.00</span> </div>
                      </div>
                      <div class="form-group">
                        <label  class="col-md-2 control-label">可使用代金券数量</label>
                        <div class="col-md-6">
                          <input type="text" name="coupon_price" id="coupon_price" value="<?=$this->data['coupon_price'] ? : '0'?>" maxlength="10" class="form-control">
                          <span class="help-block">例如：3</span> </div>
                      </div> 
                      <div class="form-group">
                        <label class="col-md-2 control-label">可使用金花结算</label>
                        <div class="col-md-9">
                          <div class="checkbox-list">
                            <label class="checkbox-inline">
                              <input id="inlineCheckbox321" value="1" <? if($this->data['can_use_gold']==1) echo ' checked';?> name="can_use_gold" type="checkbox">
                              打勾表示此商品允许使用金花结算</label>
                          </div>
                        </div>
                      </div>
                      <hr>
                      <div class="form-group">
                        <label  class="col-md-2 control-label">赠送商品票数量</label>
                        <div class="col-md-6">
                          <input type="text" name="give_ticket" value="<?=$this->data['give_ticket'] ? : '0'?>" maxlength="10" class="form-control">
                          <span class="help-block">例如：10000</span> </div>
                      </div>
                      <div class="form-group">
                        <label  class="col-md-2 control-label">赠送代金券数量</label>
                        <div class="col-md-6">
                          <input type="text" name="give_coupon" value="<?=$this->data['give_coupon'] ? : '0'?>" maxlength="10" class="form-control">
                          <span class="help-block">例如：10</span> </div>
                      </div>
                      <hr>
                      <div class="form-group memberprice">
                        <label  class="col-md-2 control-label">分润金额(自己)</label>
                        <div class="col-md-6">
                          <input type="text" name="price_me" maxlength="10" class="form-control" value="<?=$this->data['price_me'] ? : '0.00'?>">
                          <span class="help-block">例如：10.00</span> </div>
                      </div>
                      <div class="form-group memberprice">
                        <label  class="col-md-2 control-label">分润金额(一级)</label>
                        <div class="col-md-6">
                          <input type="text" name="price_level1" maxlength="10" class="form-control" value="<?=$this->data['price_level1'] ? : '0.00'?>">
                          <span class="help-block">例如：10.00</span> </div>
                      </div>
                      <div class="form-group memberprice">
                        <label  class="col-md-2 control-label">分润金额(二级)</label>
                        <div class="col-md-6">
                          <input type="text" name="price_level2" maxlength="10" class="form-control" value="<?=$this->data['price_level2'] ? : '0.00'?>">
                          <span class="help-block">例如：10.00</span> </div>
                      </div>
                      <hr>
                      <div class="form-group">
                        <label  class="col-md-2 control-label">计量单位</label>
                        <div class="col-md-6">
                          <input type="text" name="goods_unit" id="_goods_unit" maxlength="20" class="form-control" value="<?php echo $this->data['goods_unit'];?>">
                          <span class="help-block">商品的单位，例如：克，件、箱、立方米、平方米、吨</span> </div>
                      </div>
                      <div class="form-group">
                        <label class="col-md-2 control-label">上架</label>
                        <div class="col-md-9">
                          <div class="checkbox-list">
                            <label class="checkbox-inline">
                              <input id="inlineCheckbox21" value="1"<? if($this->data['is_on_sale']==1) echo ' checked';?> name="is_on_sale" type="checkbox">
                              打勾表示允许上架销售，否则不允许销售 </label>
                          </div>
                        </div>
                      </div>    
                      <hr>
                      <div class="form-group">
                        <label class="col-md-2 control-label">是否升级商品</label>
                        <div class="col-md-9">
                          <div class="checkbox-list">
                            <label class="checkbox-inline">
                              <input id="inlineCheckbox231" value="1"<? if($this->data['upgrade_goods']==1) echo ' checked';?> name="upgrade_goods" type="checkbox">
                              打勾表示购买后可根据金额升级为良品e店或西海e店 </label>
                          </div>
                        </div>
                      </div>                  
                      <div class="form-group">
                        <label class="col-md-2 control-label">不可退款产品</label>
                        <div class="col-md-9">
                          <div class="checkbox-list">
                            <label class="checkbox-inline">
                              <input id="inlineCheckbox4531" value="1"<? if($this->data['can_not_reback']==1) echo ' checked';?> name="can_not_reback" type="checkbox">
                              打够表示购买后不可申请退款 </label>
                          </div>
                        </div>
                      </div>
                      <hr>
                      <div class="form-group">
                        <label class="col-md-2 control-label">推荐产品</label>
                        <div class="col-md-9">
                          <div class="checkbox-list">
                            <label class="checkbox-inline">
                              <input id="inlineCheckbox21" value="1" <? if($this->data['is_best']==1) echo ' checked';?> name="is_best" type="checkbox">
                              打勾表示此商品为推荐产品</label>
                          </div>
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="col-md-2 control-label">今日特卖</label>
                        <div class="col-md-9">
                          <div class="checkbox-list">
                            <label class="checkbox-inline">
                              <input id="inlineCheckbox21" value="1" <? if($this->data['is_hot']==1) echo ' checked';?> name="is_hot" type="checkbox">
                              打勾表示此商品为今日特卖</label>
                          </div>
                        </div>
                      </div>
                      


                      <hr> 
                      <div class="form-group">
                        <label for="exampleInputFile122" class="col-md-2 control-label">今日特卖封面图</label>
                        <div class="col-md-9">
                          <input id="exampleInputFile122" name="pic0_big" type="file">
                          <p class="help-block">只允许上传JPG图片，2M以内，图片尺寸宽800像素(px)，高400像素(px)</p>
                          <?php if($this->data['hot_docid']>0 && $this->data['docs'][$this->data['hot_docid']]){?>
                          <p>图片已经存在，<a href="<?=$this->data['docs'][$this->data['hot_docid']];?>" target="_blank">点击查看&gt;&gt;</a></p>
                          <?
                          }
                          ?>
                        </div>
                      </div>
                      <div class="form-group">
                        <label for="exampleInputFile1" class="col-md-2 control-label">商品大图1</label>
                        <div class="col-md-9">
                          <input id="exampleInputFile1" name="pic_big" type="file">
                          <p class="help-block">只允许上传JPG图片，2M以内，图片尺寸宽1000像素(px)，高1000像素(px)</p>
                          <?php if($this->data['pic_docid']>0 && $this->data['docs'][$this->data['pic_docid']]){?>
                          <p>图片已经存在，<a href="<?=$this->data['docs'][$this->data['pic_docid']];?>" target="_blank">点击查看&gt;&gt;</a></p>
                          <?
                          }
                          ?>
                        </div>
                      </div>
                      <div class="form-group">
                        <label for="exampleInputFile1" class="col-md-2 control-label">商品大图2</label>
                        <div class="col-md-9">
                          <input id="exampleInputFile1" name="pic2_big" type="file">
                          <p class="help-block">只允许上传JPG图片，2M以内，图片尺寸宽1000像素(px)，高1000像素(px)</p>
                          <?php if($this->data['pic2_docid']>0 && $this->data['docs'][$this->data['pic2_docid']]){?>
                          <p>图片已经存在，<a href="<?=$this->data['docs'][$this->data['pic2_docid']];?>" target="_blank">点击查看&gt;&gt;</a></p>
                          <?
                          }
                          ?>
                        </div>
                      </div>
                      <div class="form-group">
                        <label for="exampleInputFile1" class="col-md-2 control-label">商品大图3</label>
                        <div class="col-md-9">
                          <input id="exampleInputFile1" name="pic3_big" type="file">
                          <p class="help-block">只允许上传JPG图片，2M以内，图片尺寸宽1000像素(px)，高1000像素(px)</p>
                          <?php if($this->data['pic3_docid']>0 && $this->data['docs'][$this->data['pic3_docid']]){?>
                          <p>图片已经存在，<a href="<?=$this->data['docs'][$this->data['pic3_docid']];?>" target="_blank">点击查看&gt;&gt;</a></p>
                          <?
                          }
                          ?>
                        </div>
                      </div>
                      <div class="form-group">
                        <label for="exampleInputFile1" class="col-md-2 control-label">商品大图4</label>
                        <div class="col-md-9">
                          <input id="exampleInputFile1" name="pic4_big" type="file">
                          <p class="help-block">只允许上传JPG图片，2M以内，图片尺寸宽1000像素(px)，高1000像素(px)</p>
                          <?php if($this->data['pic4_docid']>0 && $this->data['docs'][$this->data['pic4_docid']]){?>
                          <p>图片已经存在，<a href="<?=$this->data['docs'][$this->data['pic4_docid']];?>" target="_blank">点击查看&gt;&gt;</a></p>
                          <?
                          }
                          ?>
                        </div>
                      </div>
                      <div class="form-group">
                        <label for="exampleInputFile1" class="col-md-2 control-label">商品大图5</label>
                        <div class="col-md-9">
                          <input id="exampleInputFile1" name="pic5_big" type="file">
                          <p class="help-block">只允许上传JPG图片，2M以内，图片尺寸宽1000像素(px)，高1000像素(px)</p>
                          <?php if($this->data['pic5_docid']>0 && $this->data['docs'][$this->data['pic5_docid']]){?>
                          <p>图片已经存在，<a href="<?=$this->data['docs'][$this->data['pic5_docid']];?>" target="_blank">点击查看&gt;&gt;</a></p>
                          <?
                          }
                          ?>
                        </div>
                      </div>

                      <div class="form-group">
                        <label for="exampleInputFile2" class="col-md-2 control-label">商品缩略图</label>
                        <div class="col-md-9">
                          <input id="exampleInputFile2" name="pic_thumb" type="file">
                          <p class="help-block">只允许上传JPG图片，2M以内</p>
                          <?php if($this->data['thumb_docid']>0 && $this->data['docs'][$this->data['thumb_docid']]){?>
                          <p>图片已经存在，<a href="<?=$this->data['docs'][$this->data['thumb_docid']];?>" target="_blank">点击查看&gt;&gt;</a></p>
            						  <?
            						  
            						  }
            						  ?>
                          <div class="input-group">
                              <div class="checkbox-list">
                                <label class="checkbox-inline">
                                  <input value="1" name="auto_thumb" id="_auto_thumb" onClick="_change_thumb();" type="checkbox">
                                  自动将商品大图生成缩略图</label>
                              </div>
                          </div>
                        </div>
                      </div>                     		 
                    </div>
                    <div class="form-actions fluid">
                      <div class="col-md-offset-3 col-md-9">
                        <button type="submit" class="btn blue">提交</button>
                      </div>
                    </div>
                  </div>
                </div>
              </div>              
              <!--Tab2-->
              <div class="tab-pane" id="tab_2">
                <div class="portlet box blue ">
                  <div class="portlet-title">
                    <div class="caption"> <i class="icon-reorder"></i> 商品详情 </div>
                  </div>
                  <div class="portlet-body form">
                    <div class="form-body">
                      <div class="form-body">
                      <div class="form-group">
                        <label class="control-label col-md-2">详细内容</label>
                        <div class="col-md-10">
                          <textarea class="ckeditor form-control" id="goods_desc" name="goods_desc" rows="6" data-error-container="#goods_desc_error"><?php echo $this->data['goods_desc']; ?></textarea>
                          <div id="goods_desc_error"></div>
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-2">上传图片</label>
                        <div class="col-md-10">
                          <iframe name="_upload" src="/channel/upload" frameborder="0" width="100%" height="280" scrolling="auto"></iframe>
                        </div>
                      </div>
                    </div>
                    </div>
                    <div class="form-actions fluid">
                      <div class="col-md-offset-3 col-md-9">
                        <button type="submit" class="btn blue">提交</button>
                      </div>
                    </div>
                  </div>                  
                </div>
              </div>

              <!--Tab3-->
              <div class="tab-pane" id="tab_3">
                <div class="portlet box blue ">
                  <div class="portlet-title">
                    <div class="caption"> <i class="icon-reorder"></i> 快递设置 </div>
                  </div>
                  <div class="portlet-body form">
                    <div class="form-body">
                      <div class="form-body">
                      
                        <div class="form-group">
                          <label  class="col-md-2 control-label">免运费</label>
                          <div class="col-md-9">
                            <div class="checkbox-list">
                              <label class="checkbox-inline">
                                <input id="inlineCheckbox21" value="1" name="is_free_shipping"<? if($this->data['is_free_shipping']==1) echo ' checked';?> type="checkbox">
                                打勾表示此商品不会产生运费 </label>
                            </div>
                          </div>
                        </div>
                        
                        <div class="form-group">
                          <label  class="col-md-2 control-label">以下地区不销售</label>
                          <div class="col-md-9">
                            <div id="province_show" style="width: 100%;display: block;overflow: hidden;margin: 0 auto;">
                            <?php foreach($this->province as $item):

                                  if( is_array($this->express_setting['no_sale']) && $this->express_setting['no_sale'][$item['region_id']] )
                                  {
                                    $checked= ' checked="checked"';
                                  }
                                  else
                                  {
                                    $checked = '';
                                  }
                              ?>
                            <div class="col-md-3">
                              <div class="checkbox-list" style="display: flex;;align-items: center;">
                                <label class="checkbox-inline" >
                                  <input id="inlineCheckbox21" name="no_sale[<?=$item['region_id'];?>]" value="<?=$item['region_id']?>"<?=$checked;?>  class="province_checkbox" type="checkbox">
                                  <?=$item['region_name']?>
                                </label>
                              </div>
                            </div>
                            <?php endforeach;?>                            
                            </div>
                          </div>
                        </div>

                        <div class="form-group">
                          <label  class="col-md-2 control-label">以下地区每件增加指定运费</label>
                          <div class="col-md-9">
                            <div id="province_show" style="width: 100%;display: block;overflow: hidden;margin: 0 auto;">
                            <?php foreach($this->province as $item):?>
                            <div class="col-md-3">
                              <div class="checkbox-list" style="display: flex;;align-items: center;">                                
                                  <?=$item['region_name']?>
                                  <input type="text" name="extra_money[<?=$item['region_id'];?>]" class="express_money" style="display: block; float: right;margin-left: 6px;width: 30%" value="<?=$this->express_setting['extra_money'][$item['region_id']]?:0?>">
                              </div>
                            </div>
                            <?php endforeach;?>                            
                            </div>
                          </div>
                        </div>

                        
                    </div>
                    </div>
                    <div class="form-actions fluid">
                      <div class="col-md-offset-3 col-md-9">
                        <button type="submit" class="btn blue">提交</button>
                      </div>
                    </div>
                  </div>                  
                </div>
              </div>

              
              <!--End Tab--> 
            </div>
          </div>
        </form>
        <!-- END SAMPLE FORM PORTLET--> 
      </div>
    </div>
    <!-- END PAGE CONTENT--> 
  </div>
  <!-- END PAGE --> 
</div>
<!-- END CONTAINER -->
<?php include($this->c['_homes']['_viewsHome'].'/_global/_footer.php');?>
<script type="text/javascript" src="/style/assets/plugins/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/style/assets/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script> 
<script type="text/javascript" src="/style/assets/plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script> 
<script>
var handleDatetimePicker = function () {
	$(".form_datetime").datetimepicker({
		language:'zh-CN',
		autoclose: true,
		format: "yyyy-mm-dd hh:ii"
	});	
	$('body').removeClass("modal-open"); // fix bug when inline picker is used in modal
}
jQuery(document).ready(function() {    
   
   App.init();
   handleDatetimePicker();
   if (jQuery().datepicker) {
       $('.date-picker').datepicker({
           rtl: App.isRTL(),
           autoclose: true
       });
       $('body').removeClass("modal-open"); // fix bug when inline picker is used in modal
     }
	    function ajaxDirect(url,data,func,async){
	        if(!async){
	            async = false;
	        }
	        $.ajax({
	            url:url,
	            type:"post",
	            dataType:"json",
	            async:async,
	            data:data,
	            success:func
	        });
	    }



	    //文本框输入
	    $("#parent_uid").on('input propertychange',function(){
	    //$("#parent_uid").keyup( function () {
	        ajaxDirect("ajax",{"act":"ajax_rele","info":$("#parent_uid").val()},function(data){
	            var htm = "";
	            if(data.length>0){
	                for ( var int = 0; int < data.length; int++) {
	                    htm += "<div class='div_item' >"+data[int].id+'-'+data[int].title+"</div>";
	                }
	                $('#div_items').html(htm);
	            }

	        });

	        $("#parent_uid").click(function () {
	            $("#div_items").css('display', 'block');
	            return false;
	        });

	        //隐藏列表框
	        $("body").click(function () {
	            $("#div_items").css('display', 'none');
	        });

	        $("#div_items").css('display', 'block');//只要输入就显示列表框

	        if ($("#parent_uid").val().length <= 0) {
	            $(".div_item").css('display', 'block');//如果什么都没填，跳出，保持全部显示状态
	            return;
	        }

	        //项点击
	        $(".div_item").click(function () {
	            $("#parent_uid").val($(this).text());
	        });
	    });


    $("#_caid").change(function(){


        ajaxDirect("ajax",{"act":"get_cate","caid": $(this).val()},function(data){

            var htmls = '<option value="">请选择商品二级分类</option>';
            if(data.length >0){
                $.each(data,function(i,v){
                    htmls +='<option value="'+v.caid+'">'+v.name+'</option>';


                })


            }

            $("#_er_caid").html(htmls);
        });

    })

    
});

function _change_thumb(){
	
	if( $("#_auto_thumb").prop("checked") ){
		$("#exampleInputFile2").prop("disabled","true");
	}
	else  $("#exampleInputFile2").removeProp("disabled");
		
}

function chkfrm(){

	if($("#_goods_name").prop("value")==""){
    swal("请填写商品名称");
    return false;
  }
  
  if($("#_er_caid").val()==""){
    swal("请选择商品分类");
    return false;
  }

  if($("#_supplierid").val()==""){
    swal("请选择供应商");
    return false;
  }

  $('#goods_desc').val($("#summernote").code());

  
}


function _insert_pic(u){
	var myckeditor = CKEDITOR.instances.goods_desc;
	myckeditor.insertHtml('<p><img src="'+u+'" /></p>');  
}


</script> 
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>